<template>
	<view class="textbody">
		<textarea class="textarea" maxlength='90' v-model="txt" placeholder="请写下您的愿望…"
			:style="{backgroundImage:'url('+ txtimg +')'}" @input="descInput" />
		<radio-group name="" class="radio" @change="radioChange">
			<label>
				<radio value="0" color=" #FF7F22" checked="true" /><text class="txt">公开</text>
			</label>
			<label style="margin-left: 12rpx;">
				<radio value="1" color=" #FF7F22" /><text class="txt">未公开</text>
			</label>
			<label class="demnum">{{demnum}}/90</label>
		</radio-group>
		<view class="incon">
			<uni-icons custom-prefix="close" type="close" size="30" color="#6A3C16" @click="black"></uni-icons>
		</view>
	</view>
</template>

<script>
	import {
		imgBaseUrl
	} from '../../../../utils/baseUrl'
	export default {
		data() {
			return {
				txt: '', //文本框的内容
				demnum: '0', //文本框
				txtimg: imgBaseUrl + '/img/missimg/xybeijing.png',
				isopen: '0' //公开与不公开
			}
		},
		methods: {
			descInput(event) {
				this.demnum = event.target.value.length;
			},
			//选择公开与不公开
			radioChange(e) {
				console.log(e.detail.value, 'e')
				this.isopen = e.detail.value
			},
			//关闭
			black(){
				this.$parent.istxt = false
			}
		}
	}
</script>

<style scoped lang="less">
	.textbody {
		width: 100%;

		.textarea {
			background-size: 100% 100%;
			width: 470rpx;
			padding: 75rpx 99rpx 110rpx 99rpx;
			height: 290rpx;
			line-height: 60rpx;
			font-size: 28rpx;
			color: #6A3C16;
			font-weight: 400;
			font-family: PingFang SC-Regular, PingFang SC;
		}

		.radio {
			font-size: 24rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #6A3C16;
			position: absolute;
			z-index: 10000;
			left: 66rpx;
			margin-top: -65rpx;
		}

		.demnum {
			font-size: 22rpx;
			font-family: PingFang SC-Regular, PingFang SC;
			font-weight: 400;
			color: #6A3C16;
			position: relative;
			// z-index: 10000;
			left: 240rpx;
			// margin-top: -44rpx;
		}

		.incon {
			position: absolute;
			z-index: 10000;
			right: 34rpx;
			top: 141rpx;
		}
	}
</style>